<!DOCTYPE html>
<html>
	<head>
		
		<title></title>
	</head>
	<body>
		<script>
        var arr=[1,34,"d",3,4,"im"];
		var n=arr.length;
		n=n+1;
		var m=parseInt(prompt("请输入插入数据的下标："));
		var a=prompt("请输入插入的数据：");
		for(var i=n;i>=m+2;i--)
		{
			arr[i-1]=arr[i-2];
		}
		arr[m]=a;
		document.write("插入数据后的数组为：");
		for(var j=0;j<n;j++)
		{
			document.write(arr[j]+",");
		}
			
		</script>
	</body>
</html>